//
//  TabBarController.swift
//  YJClub
//
//  Created by mac on 2017/10/18.
//  Copyright © 2017年 MapleStory. All rights reserved.
//

import UIKit

class TabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        
        let trainVC = TrainTableViewController()
        let train = UINavigationController(rootViewController: trainVC)
        let clubVC = ClubTableViewController()
        let club = UINavigationController(rootViewController: clubVC)
        let mainVC = MainViewController()
        let main = UINavigationController(rootViewController: mainVC)
        let layout = UICollectionViewFlowLayout()
        layout.itemSize = CGSize(width: (UIScreen.main.bounds.width-10)/2, height: 205)
        layout.minimumInteritemSpacing = 10
        layout.minimumLineSpacing = 10
        let imageVC = ImageCollectionViewController(collectionViewLayout: layout)
        let image = UINavigationController(rootViewController: imageVC)
        let personVC = PersonTableViewController()
        let person = UINavigationController(rootViewController: personVC)

        self.viewControllers = [train,club,main,image,person]
        self.tabBar.isTranslucent = false
        let train1 = self.tabBar.items![0]
        train1.title = "培训"
        let trainImageNo = UIImage(named: "first_unselect")?.withRenderingMode(.alwaysOriginal)
        let trainImageSe = UIImage(named: "first_select")?.withRenderingMode(.alwaysOriginal)
        train1.image = trainImageNo
        train1.selectedImage = trainImageSe
        let club1 = self.tabBar.items![1]
        club1.title = "俱乐部"
        let clubImageNo = UIImage(named: "second_unselect")?.withRenderingMode(.alwaysOriginal)
        let clubImageSe = UIImage(named: "second_select")?.withRenderingMode(.alwaysOriginal)
        club1.image = clubImageNo
        club1.selectedImage = clubImageSe
        let main1 = self.tabBar.items![2]
        let mainImageNo = UIImage(named: "3")?.withRenderingMode(UIImageRenderingMode.alwaysOriginal)
        let mainImageSe = UIImage(named: "3S")?.withRenderingMode(.alwaysOriginal)
        main1.selectedImage = mainImageSe
        main1.image = mainImageNo
        main1.title = ""
        let image1 = self.tabBar.items![3]
        let imageImageNo = UIImage(named: "fourth_unselect")?.withRenderingMode(.alwaysOriginal)
        let imageImageSe = UIImage(named: "fourth_select")?.withRenderingMode(.alwaysOriginal)
        image1.image = imageImageNo
        image1.selectedImage = imageImageSe
        image1.title = "晒图"
        let person1 = self.tabBar.items![4]
        let personImageNo = UIImage(named: "third_unselect")?.withRenderingMode(.alwaysOriginal)
        let personImageSe = UIImage(named: "third_select")?.withRenderingMode(.alwaysOriginal)
        person1.image = personImageNo
        person1.selectedImage = personImageSe
        person1.title = "我"
        
        
        
        self.tabBar.barTintColor = UIColor.white
        self.tabBar.backgroundColor = UIColor.white
        self.tabBar.tintColor = UIColor.black
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
